home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_actor_ic.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
3KB
|
114 lines
# Jedi Knight Cog Script
#
# ACTOR_IC.COG
#
#
# Actor COG for Commandos with Rifles
# Creates powerup upon death
#
# 7/28/97 [CR] Doubled saber damage for single player gameplay reasons
#
# [CR]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
#
# ========================================================================================
symbols
message killed
message skill
message damaged
template powerup=+Dstrifle local
thing newThing local
thing victim local
int damage local
int bin local
int senderref=-1 local
ai flee_ai=noweapon.ai local
vector currentpos local
end
# ========================================================================================
code
damaged:
damage = GetParam(0);
if(GetParam(1) == 16)
{
damage = (damage * 2.0);
}
ReturnEx(damage);
return;
# ........................................................................................
killed:
victim = GetSenderRef();
if (GetActorWeapon( victim, 1 ) != -1)
{
AmputateJoint( victim, 3 );
newThing = CreateThing(powerup, victim);
SetLifeleft(newThing, 200.0);
}
return;
# ........................................................................................
skill:
bin = GetParam(0);
if (bin == 24) // Force Pull
{
// he's a fighter, not a fleer... -srs
senderref = GetSenderRef();
// If he hasn't been pulled yet...
if (GetActorWeapon (senderref, 1) != -1)
{
SetActorWeapon(senderref, 1, -1);
newThing = CreateThing(powerup, GetSenderRef());
SetLifeleft(newThing, 30.0);
AISetClass (senderref, flee_ai);
AISetMode(senderref, 0x4);
ReturnEx(newThing);
}
else
{
// Give the actor a shove towards the player.
currentpos = VectorSub(GetThingPos(GetLocalPlayerThing(), senderref));
currentpos = VectorScale(VectorNorm(currentPos), 250);
ApplyForce(senderref, currentpos);
ReturnEx(-1);
}
//AIFlee(senderref, GetLocalPlayerThing());
Return;
}
else
if (bin == 31) // Force Grip
{
ReturnEx(10); // return base damage that is taken by this actor.
return;
}
else
if (bin == 34) // Deadly Sight
{
ReturnEx(5); // return base damage that is taken by this actor.
return;
}
ReturnEx(-1);
return;
end